Optimal. Leaf size=68 \[ 3 a b^2 x-\frac {3 a^2 b \tanh ^{-1}(\cos (e+f x))}{f}+\frac {b \left (a^2-b^2\right ) \cos (e+f x)}{f}-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2871, 3102,
2814, 3855} \begin {gather*} \frac {b \left (a^2-b^2\right ) \cos (e+f x)}{f}-\frac {3 a^2 b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f}+3 a b^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 2871
Rule 3102
Rule 3855
Rubi steps
\begin {align*} \int \csc ^2(e+f x) (a+b \sin (e+f x))^3 \, dx &=-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f}+\int \csc (e+f x) \left (3 a^2 b+3 a b^2 \sin (e+f x)-b \left (a^2-b^2\right ) \sin ^2(e+f x)\right ) \, dx\\ &=\frac {b \left (a^2-b^2\right ) \cos (e+f x)}{f}-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f}+\int \csc (e+f x) \left (3 a^2 b+3 a b^2 \sin (e+f x)\right ) \, dx\\ &=3 a b^2 x+\frac {b \left (a^2-b^2\right ) \cos (e+f x)}{f}-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f}+\left (3 a^2 b\right ) \int \csc (e+f x) \, dx\\ &=3 a b^2 x-\frac {3 a^2 b \tanh ^{-1}(\cos (e+f x))}{f}+\frac {b \left (a^2-b^2\right ) \cos (e+f x)}{f}-\frac {a^2 \cot (e+f x) (a+b \sin (e+f x))}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 87, normalized size = 1.28 \begin {gather*} \frac {-2 b^3 \cos (e+f x)-a^3 \cot \left (\frac {1}{2} (e+f x)\right )+6 a b \left (b (e+f x)-a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )+a^3 \tan \left (\frac {1}{2} (e+f x)\right )}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 61, normalized size = 0.90
method | result | size |
derivativedivides | \(\frac {-a^{3} \cot \left (f x +e \right )+3 a^{2} b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+3 a \,b^{2} \left (f x +e \right )-b^{3} \cos \left (f x +e \right )}{f}\) | \(61\) |
default | \(\frac {-a^{3} \cot \left (f x +e \right )+3 a^{2} b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+3 a \,b^{2} \left (f x +e \right )-b^{3} \cos \left (f x +e \right )}{f}\) | \(61\) |
risch | \(3 a \,b^{2} x -\frac {b^{3} {\mathrm e}^{i \left (f x +e \right )}}{2 f}-\frac {b^{3} {\mathrm e}^{-i \left (f x +e \right )}}{2 f}-\frac {2 i a^{3}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}+\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f}-\frac {3 a^{2} b \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f}\) | \(107\) |
norman | \(\frac {\frac {a^{3} \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {2 b^{3} \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {2 b^{3} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {4 b^{3} \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {a^{3}}{2 f}-\frac {a^{3} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {a^{3} \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}+3 a \,b^{2} x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+9 a \,b^{2} x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+9 a \,b^{2} x \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+3 a \,b^{2} x \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{3}}+\frac {3 a^{2} b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 73, normalized size = 1.07 \begin {gather*} \frac {6 \, {\left (f x + e\right )} a b^{2} - 3 \, a^{2} b {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - 2 \, b^{3} \cos \left (f x + e\right ) - \frac {2 \, a^{3}}{\tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 107, normalized size = 1.57 \begin {gather*} -\frac {3 \, a^{2} b \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 3 \, a^{2} b \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) + 2 \, a^{3} \cos \left (f x + e\right ) - 2 \, {\left (3 \, a b^{2} f x - b^{3} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \, f \sin \left (f x + e\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (e + f x \right )}\right )^{3} \csc ^{2}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 146 vs.
\(2 (72) = 144\).
time = 0.44, size = 146, normalized size = 2.15 \begin {gather*} \frac {6 \, {\left (f x + e\right )} a b^{2} + 6 \, a^{2} b \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) + a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \frac {2 \, a^{2} b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + a^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 \, a^{2} b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 4 \, b^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + a^{3}}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.72, size = 194, normalized size = 2.85 \begin {gather*} \frac {a^3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2\,f}-\frac {a^3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a^3+4\,b^3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}+\frac {6\,a\,b^2\,\mathrm {atan}\left (\frac {36\,a^2\,b^4}{36\,a^3\,b^3-36\,a^2\,b^4\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}+\frac {36\,a^3\,b^3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{36\,a^3\,b^3-36\,a^2\,b^4\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f}+\frac {3\,a^2\,b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________